package com.sofaguest.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sofaguest.entry.SofaResult;
import com.sofaguest.service.OrderService;

@Controller
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService order;

    @ResponseBody
    @RequestMapping("/preOrder")
    public SofaResult preOrder(String sofaId, String userId, String custName, String certNum, String linktel,
            String userNumber, String opentime, String endtime) {
        return order.preOrder(sofaId, userId, custName, certNum, linktel, userNumber, opentime, endtime);
    }

    @ResponseBody
    @RequestMapping("/qryAllOrder.do")
    public SofaResult qryAllOrder(String userId, String userType) {
        return order.qryAllOrder(userId, userType);
    }

    @ResponseBody
    @RequestMapping("/modifyOrderStatus.do")
    public SofaResult modifyOrderStatus(int status, String orderId) {
        return order.modifyOrderStatus(status, orderId);
    }

    @ResponseBody
    @RequestMapping("/commitOrder.do")
    public SofaResult commitOrder(String msg, String orderId) {
        return order.commitOrder(msg, orderId);
    }

    @ResponseBody
    @RequestMapping("/getOrderList.do")
    public SofaResult getOrderList(int byTimeTag) {
        return order.getOrderList(byTimeTag);
    }
}
